/**
 * Message.java
 * ************************** 
 * @date Mar 18, 2011
 * @author Michele Tamburini
 * 
 * **************************
 */
package messages;

import gossipServices.basic.nodeDescriptors.NodeDescriptor;

import java.io.Serializable;

/**
 * Description:
 * Each Node in the Cloud is exchanging Message(es) with other Nodes.
 * A message must expose an identifier, the sender and the destination
 * Nodes. 
 * The body of a Message may be of any type, but need to implement the 
 * Serializable interface. 
 * This must be ensured for ALL object that are inserted in a Message.
 * Each service performing a gossip communication through the net
 * will probably need its own type of Message, that can be built 
 * starting from this interface.
 * 
 */
public interface Message extends Serializable {
	/**
	 * returns the sender of the current Message in form
	 * of NodeDescriptor. 
	 * @return sender : NodeDescriptor
	 */
	public NodeDescriptor getSender();
	
	/**
	 * Returns the destination Node of a message.
	 * @return destination : NodeDescriptor
	 */
	public NodeDescriptor getDest();
	
	/**
	 * Return the body, what is contained into a Message.
	 * @return body : Object
	 */
	public Object getBody();
	
	/**
	 * Return the id of the current message.
	 * @return id : String
	 */
	public String getID();
}
